A flip-flop or latch is a circuit that has two stable states and can be used to store state information. Such a circuit is generally used as a data storage element. A single latch stores one bit of data as long as the latch circuit is powered. Further, an output of a latch circuit varies based on the input as long as an enable signal is asserted. Typical latch circuits are volatile, i.e., the data stored in the latch circuit is lost when a power supply to the latch circuit is turned off. A conventional technique to enable a latching circuit to retain data includes coupling the latching circuit to a retention latch with its own separate power supply. In this technique, when the power supply to the latching circuit is switched off, data stored in the latching circuit is copied to the retention latch. However, such an approach requires redundant circuitry, which requires additional space in an integrated circuit that could otherwise have been saved. Further, an additional power supply is required, thereby adding to the overall power consumption of the latching circuit.